package com.jiaai.shop.store.api;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.jiaai.shop.store.entity.TMemberGoods;
import com.jiaai.shop.store.service.ITMemberGoodsService;
import com.jiaai.wgj.common.json.RestResultGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author
 * @since 2018-04-11
 */
@Controller
@RequestMapping("/store/tMemberGoods")
public class TMemberGoodsController {
    private  static  final Logger log= LoggerFactory.getLogger(TMemberGoodsController.class);
    @Autowired
    private ITMemberGoodsService memberGoodsService;

    @GetMapping("/buy/list")
    public  Object findBuyGoods(@RequestParam("mId") String mId){
        try {
            return RestResultGenerator.genSuccessResult(memberGoodsService.findUserGoodsByMId(mId));
        }catch (Exception e){
            log.error("find user buy goods error:"+e.getMessage());
            return  RestResultGenerator.genErrorResult("error");
        }
    }
}
